//
//  ListModel.m
//  10-易车
//
//  Created by dllo on 16/7/27.
//  Copyright © 2016年 tusm. All rights reserved.
//

#import "ListModel.h"

@implementation ListModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

- (instancetype)initWithDic:(NSDictionary *)dic{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+ (instancetype)listModelWithDic:(NSDictionary *)dic{
    return [[ListModel alloc] initWithDic:dic];
}
+ (NSArray *)getDataFromPlist{
    NSDictionary *dicPlist = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"YiChe" ofType:@"plist"]];
    NSDictionary *dicData = dicPlist[@"data"];
    NSArray *arrList = dicData[@"list"];
    NSMutableArray *arrModels = [NSMutableArray array];
        for (NSDictionary *dic in arrList) {
        [arrModels addObject:[self listModelWithDic:dic]];
    }
    return arrModels;
}
@end
